package com.spotmanger.project.modular.spottable.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.spotmanger.project.modular.spottable.entity.SpottableZrzsEntity;
import com.spotmanger.project.modular.spottable.mapper.SpottableZrzsNewMapper;
import com.spotmanger.project.modular.spottable.service.SpottableZrzsNewService;
import org.springframework.stereotype.Service;


@Service("spottableZrzsNewService")
public class SpottableZrzsNewServiceImpl extends ServiceImpl<SpottableZrzsNewMapper, SpottableZrzsEntity> implements SpottableZrzsNewService {
    /**
     * 以TBBH为主,结合 LambdaQueryWrapper的模糊搜索方法。
     */
    @Override
    public LambdaQueryWrapper<SpottableZrzsEntity> searchByTBBH(SpottableZrzsEntity spottableZrzs) {
        LambdaQueryWrapper<SpottableZrzsEntity> queryWrapper = Wrappers.lambdaQuery();
        if (spottableZrzs.getTBBH() != null) {
            queryWrapper.like(SpottableZrzsEntity::getTBBH, spottableZrzs.getTBBH());
        } else {
            return queryWrapper;
        }
        return queryWrapper;
    }
}
